package saima;

import java.util.Scanner;

public class 股神 {

    public static void main(String[] args) {
        int n;
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        System.out.println(function(n));

    }

    public static int function(long n){
        int k =1;
        int result = 1;
        while (n>1){
            for(int i=1;i<=k;i++){
                n--;
                if(n<1){
                    return result;
                }
                result++;
            }
            n--;
            if(n<1){
                return result;
            }
            result--;
            k++;
        }
        return result;
    }
}
